/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package candidate.abstractClasses;

import abstractClasses.AbstractEntityList;
import entities.Candidate;
import facades.AbstractFacade;
import javax.enterprise.event.Observes;
import javax.enterprise.event.Reception;
import javax.enterprise.event.TransactionPhase;
import javax.inject.Inject;
import qualifiers.EditedEntityEvent;
import qualifiers.LoggedIn;

/**
 *
 * @author Damián
 * @param <T>
 * @param <F>
 */
public abstract class CandidateAbstractEntityList<T,F extends AbstractFacade> extends AbstractEntityList<T, F> {
    @Inject
    @LoggedIn
    private Candidate candidate;
    
    public void onEditedCcandidate(@Observes(during=TransactionPhase.AFTER_SUCCESS,notifyObserver = Reception.IF_EXISTS) @EditedEntityEvent Candidate candidate){
        this.setCandidate(candidate);
    }

    /**
     * @return the candidate
     */
    public Candidate getCandidate() {
        return candidate;
    }

    /**
     * @param candidate the candidate to set
     */
    public void setCandidate(Candidate candidate) {
        this.candidate = candidate;
    }
    
}
